package com.SDU.policedispatch.controller.user;

import com.SDU.policedispatch.service.user.UserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/account")
public class AccountController {

    @Autowired
    private UserAccountService userAccountService;


    @GetMapping
    public Map<String, String> getAllAccounts() {
        // 处理 /api/account 请求的逻辑
        return userAccountService.UserInfo();
    }

    @GetMapping("/{id}")
    public Map<String, String> getAccountById(@PathVariable String id) {
        // 处理 /api/account/{id} 请求的逻辑
        return userAccountService.UserAccount(id);
    }
}
